package com.examples.messagebox;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

public class MessageBoxBasic {

  public static void main(String[] a) {
	  Display d = Display.getDefault();
    Shell s = new Shell(d);
    MessageBox messageBox = new MessageBox(s, SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
    messageBox.setMessage("Do you really want to exit?");
    messageBox.setText("Exiting Application");
    int response = messageBox.open();
    if(response == SWT.OK)
        System.out.println("Ok clicked");
    else if(response == SWT.CANCEL)
        System.out.println("Cancel clicked");

    
  }
}